package com.example.qxfw.dataBaseManager.nyzjk.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.example.qxfw.common.entity.ThirtyyearYearStatics;
import com.example.qxfw.common.entity.qx.SmallScaleStation;
import com.example.qxfw.common.mapper.AgriWeatherDistRecordMapperXml;
import com.example.qxfw.common.mapper.SmallscaleStationMapperXml;
import com.example.qxfw.common.mapper.ThirtyyearYearStaticsMapperXml;
import com.example.qxfw.dataBaseManager.nyzjk.service.QxyzbzqhzService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/************************************
 *
 * @author : HuangDeYin Jolly
 * @since : JDK 11
 * @Date : 2023/7/6  星期四   3:00
 * @description : 此类用来
 ***************************************/
@Service
public class QxyzbzqhzServiceImpl implements QxyzbzqhzService {

    @Autowired
    private AgriWeatherDistRecordMapperXml agriWeatherDistRecordMapperXml;

    @Autowired
    private SmallscaleStationMapperXml smallscaleStationMapperXml;

    @Autowired
    private ThirtyyearYearStaticsMapperXml thirtyyearYearStaticsMapperXml;


    @Override
    public List<SmallScaleStation> getByStationID(final String stationid) {
        return smallscaleStationMapperXml.selectList(new LambdaQueryWrapper<SmallScaleStation>()
                .like(SmallScaleStation::getStationid,stationid));
    }

    @Override
    public List<ThirtyyearYearStatics> selectStationIdList(final List<String> ids) {
        return thirtyyearYearStaticsMapperXml.selectList(new LambdaQueryWrapper<ThirtyyearYearStatics>()
                .in(CollectionUtils.isNotEmpty(ids), ThirtyyearYearStatics::getStationid, ids)
        );
    }
}
